<template>
  <el-container>
    <el-header>
      <div class="systemTitle">
        <img src="../assets/whayer.png" alt="logo" width="80px" />
        <span>华雁ip地址管理</span>
      </div>
      <div class="loginUser">
        <div class="user"><i class="el-icon-user-solid"></i> <span>admin</span></div>
        <div class="logout" @click="logout"><i class="el-icon-warning"></i> <span>退出</span></div>
      </div>
    </el-header>
    <el-container>
      <el-aside width="160px">
        <el-menu default-active="2" background-color="#545c64" text-color="#fff" active-text-color="#ffd04b" router>
          <el-submenu index="1">
            <template slot="title">
              <i class="el-icon-menu"></i>
              <span>ip管理</span>
            </template>
            <el-menu-item index="/ip/iplist">ip列表</el-menu-item>
            <el-menu-item index="/ip/segment">网段管理</el-menu-item>
          </el-submenu>
          <el-submenu index="2">
            <template slot="title">
              <i class="el-icon-coin"></i>
              <span>资产管理</span>
            </template>
            <el-menu-item index="/assets/equiplist">设备列表</el-menu-item>
            <el-menu-item index="/assets/models">型号配置</el-menu-item>
          </el-submenu>
          <el-submenu index="3">
            <template slot="title">
              <i class="el-icon-s-custom"></i>
              <span>组织架构</span>
            </template>
            <el-menu-item index="/org/userlist">用户列表</el-menu-item>
            <el-menu-item index="/org/department">部门列表</el-menu-item>
          </el-submenu>
        </el-menu>
      </el-aside>
      <el-main>
        <router-view></router-view>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
export default {
  data() {
    return {}
  },
  created() {},
  methods: {
    logout() {
      sessionStorage.removeItem('token')
      this.$router.push('/login')
    }
  }
}
</script>

<style lang="less" scoped>
.el-container {
  height: 100%;
  .el-header {
    background: rgb(0, 186, 139);
    height: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    .systemTitle {
      display: inherit;
      span {
        display: inherit;
        margin-left: 10px;
        align-items: center;
        color: #fefefe;
        font-family: Verdana, Geneva, sans-serif;
        font-weight: bold;
        font-size: 16px;
      }
    }
    .loginUser {
      display: inherit;
      color: #eddede;
      div {
        margin-right: 15px;
      }
      .logout {
        span:hover {
          cursor: pointer;
          color: #FFF;
        }
      }
    }
  }
  .el-aside {
    background: #606266;
    .el-menu {
      border-right: 0px;
    }
    .el-menu-item {
      min-width: unset;
    }
  }
  .el-main {
    background: rgb(249, 246, 241);
  }
}
</style>
